package org.emet.entity.biz;

import java.math.BigDecimal;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.emet.help.CGResource;
import org.emet.jee.console.entity.BaseEntity;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.Cascade;

@Entity
@Table(name = "T_CREMATION_HIST")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class CremationHist extends BaseEntity {
	@CGResource("xxxxxx")
	private Registration registration;

	private Long crematorId;
	@CGResource("火化炉")
	private String crematorName;
	//预定开始时间
	@CGResource("预定时间")
	private java.util.Date preStartDate;
	@CGResource("开始时间")
	private java.util.Date startDate;
	@CGResource("结束时间")
	private java.util.Date endDate;
	@CGResource("工作人员")
	private String worker;
	private BigDecimal fee;
	private Boolean paied = false;
	@CGResource("备注")
	private String remark;

	public BigDecimal getFee() {
		return fee;
	}

	public void setFee(BigDecimal fee) {
		this.fee = fee;
	}

	public Boolean isPaied() {
		return paied;
	}

	public void setPaied(Boolean paied) {
		this.paied = paied;
	}

	@ManyToOne(targetEntity = Registration.class)
	@Cascade({ org.hibernate.annotations.CascadeType.SAVE_UPDATE })
	@JoinColumn(name = "reg_id")
	public Registration getRegistration() {
		return registration;
	}

	public void setRegistration(Registration registration) {
		this.registration = registration;
	}

	public String getCrematorName() {
		return crematorName;
	}

	public void setCrematorName(String crematorName) {
		this.crematorName = crematorName;
	}

	public Long getCrematorId() {
		return crematorId;
	}

	public void setCrematorId(Long crematorId) {
		this.crematorId = crematorId;
	}

	public java.util.Date getPreStartDate() {
		return preStartDate;
	}

	public void setPreStartDate(java.util.Date preStartDate) {
		this.preStartDate = preStartDate;
	}

	public java.util.Date getStartDate() {
		return startDate;
	}

	public void setStartDate(java.util.Date startDate) {
		this.startDate = startDate;
	}

	public java.util.Date getEndDate() {
		return endDate;
	}

	public void setEndDate(java.util.Date endDate) {
		this.endDate = endDate;
	}

	public String getWorker() {
		return worker;
	}

	public void setWorker(String worker) {
		this.worker = worker;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}
}
